﻿$(document).ready(function () {
    GetAllGuide();
})


var template = {
    GuideInfo: '<div class="span4"><div style="margin-bottom: 10px;" class="thumbnail"><div class="text-center"><a target="_blank" href="/site/detail/1002"><img src="http://www.wanzi.cc/http://www.wanzi.cc/uploads/service/51d2841715f41.jpg"></a></div><div class="caption"><strong><small><a style="font-size: 14px;" target="_blank" href="/site/detail/1002">{$city}</a></small></strong><p><small><strong>小樽</strong></small></p><div style="font-size: 12px; border-top: 1px dashed #CCCCCC; padding-top: 5px;" class="masthead"><div class="pull-right"></div><a href="javascript:;"><strong>欢迎大家来到丸子地球</strong></a></div></div></div></div>'
};

function GetAllGuide() {

    JSONWebServiceA("~/../Handler/Search.ashx", "{}", function (data) {

        var html1 = " <div class='ct_box'><div class='row-fluid'>";
        var objJSON = JQueryExtend.EvalJSON(data);
        if (objJSON.length > 0) {
            for (var i = 0; i < objJSON.length; i++) {
                if (i % 3 == 0) {
                    html1 += "</div>";
                    html1 += "<div class='span4'><div style='margin-bottom: 10px;' class='thumbnail'><div class='text-center'><a target='_blank' href='GuidDetail.aspx?id=" + objJSON[i].uid + "'><img src='" + objJSON[i].heardImg + "'></a>" +
                    "</div><div class='caption'><strong><small><a style='font-size: 14px;' target='_blank' href='GuidDetail.aspx?id=" + objJSON[i].uid + "'>" + objJSON[i].city + "</a></small></strong><p>" +
                    "<small><strong>" + objJSON[i].userName + "</strong></small></p><div style='font-size: 12px; border-top: 1px dashed #CCCCCC; padding-top: 5px;' class='masthead'><div class='pull-right'></div>" +
                    "<a href='javascript:;'><strong>" + objJSON[i].title + "</strong></a></div></div></div></div>";
                    html1 += "<div class='row-fluid'>";
                }
                else {
                    html1 += "<div class='span4'><div style='margin-bottom: 10px;' class='thumbnail'><div class='text-center'><a target='_blank' href='GuidDetail.aspx?id=" + objJSON[i].uid + "'><img src='" + objJSON[i].heardImg + "'></a>" +
                    "</div><div class='caption'><strong><small><a style='font-size: 14px;' target='_blank' href='GuidDetail.aspx?id=" + objJSON[i].uid + "'>" + objJSON[i].city + "</a></small></strong><p>" +
                    "<small><strong>" + objJSON[i].userName + "</strong></small></p><div style='font-size: 12px; border-top: 1px dashed #CCCCCC; padding-top: 5px;' class='masthead'><div class='pull-right'></div>" +
                    "<a href='javascript:;'><strong>" + objJSON[i].title + "</strong></a></div></div></div></div>";
                 
                }
            }
        }
        html1 += "<div class='row-fluid'>";
        html1 += "</div>";
        $("#div_html").html(html1);
    });  
}